package com.guyaning.deyson_core.core.app;

import android.content.Context;
import android.os.Handler;

/**
 * Created by Administrator on 2018/3/21.
 */

public final  class Deyson {

    public static Configurator init(Context context){
        Configurator.getInstance()
                    .getDEYSON_CONFIGS()
                    .put(Config_Type.APPLICATION_CONTEXT,context.getApplicationContext());
       return Configurator.getInstance();
    }

    public static Configurator getConfigurator() {
        return Configurator.getInstance();
    }

    public static <T> T getConfiguration(Object key) {
        return getConfigurator().getConfiguration(key);
    }

    public static Context getApplicationContext() {
        return getConfiguration(Config_Type.APPLICATION_CONTEXT);
    }

    public static Handler getHandler() {
        return getConfiguration(Config_Type.HANDLER);
    }



}
